package xin.javashare.designPattern.creation.singleton;

/**
 * 使用静态代码块实现单例模式
 */
public class StaticCodeBlockSingleton {
    private static StaticCodeBlockSingleton instance = null;
    private StaticCodeBlockSingleton() {
    }
    // 静态代码块
    static {
        instance = new StaticCodeBlockSingleton();
    }
    public static StaticCodeBlockSingleton getInstance() {
        return instance;
    }
}
